/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Aug 13, 2009 12:52:33 AM $
 *
 * Author: Eric Yang
 * Date  : Aug 13, 2009 12:52:33 AM
 *
 */
package com.gooex.web.action.user;

import com.gooex.domain.organization.User;
import com.gooex.web.action.BaseAnonymousAction;


/**
 * @author Eric Yang
 * @version 1.0
 */
public class CreateAccount extends BaseAnonymousAction {

	private User user;

	private String repassword;

	private String password;

	public String execute() throws Exception {
		try {
			user.setPassword(password);
			userManager.saveUser(user);
			sessionContext.setSessionFlag(user);
		} catch (Exception e) {
			addActionError(e.getMessage());
			return ERROR;
		}
		return SUCCESS;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setRepassword(String repassword) {
		this.repassword = repassword;
	}

	public String getRepassword() {
		return repassword;
	}

	public String getPassword() {
		return password;
	}

}
